import os

from pathlib import Path

from drek.config import get_directories_of_interest, get_all_directories_of_interest, get_dot_dir  # type: ignore
from drek.utils.environ import get_home_dir  # type: ignore


def show_info(
    directories_of_interest: list = get_all_directories_of_interest(),
) -> None:
    for d in directories_of_interest:
        foo = f"{get_home_dir()}/{d}"
        print(f"{foo}:")
        if Path(foo).exists():
            for f in os.listdir(foo):
                print(f)
        else:
            print("Err: does not exist!")
        print("")


def init_dot_directory() -> None:
    dot_dir = Path(f"{get_home_dir()}/{get_dot_dir()}")
    if not dot_dir.exists():
        dot_dir.mkdir()
